﻿using BCDto.Sim.Admin.Admin;
using BCDto.TMS.Agent.AgentAreaRecord;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCService.TMS.Agent.AgentAreaRecord
{
    /// <summary>
    /// 代理商区域记录
    /// </summary>
    public interface IAgentAreaRecordService
    {
        /// <summary>
        /// 检查区县是否已授权给此代理商
        /// </summary>
        /// <param name="countyCode">区县编码</param>
        /// <param name="agentRecordId">代理商Id</param>
        /// <returns></returns>
        bool CheckCountyAuthorize(string countyCode, long agentRecordId);
        /// <summary>
        /// 添加代理商区域记录
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="agentRecordId">代理商记录Id</param>
        /// <param name="requestDto">代理商区域添加模型信息</param>
        /// <returns></returns>
        AgentAreaRecordDto Add(AdminDto admin, long agentRecordId, AgentAreaRecordRequestDto requestDto);
        /// <summary>
        /// 获取代理商区域省市区三级联动树形列表
        /// </summary>
        /// <param name="adminDto">管理员信息</param>
        /// <returns></returns>
        List<AgentAreaTreeDto> GetAgentAreaTree(AdminDto adminDto);
        /// <summary>
        /// 获取已经存在的代理商区域列表
        /// </summary>
        /// <param name="adminDto">管理员信息</param>
        /// <returns></returns>
        IEnumerable<AgentAreaRecordDto> AgentAreaExistsList(AdminDto adminDto);

        /// <summary>
        /// 根据区县编码获取底层代理商区域记录
        /// </summary>
        /// <param name="countyCode">区县编码</param>
        /// <returns></returns>
        AgentAreaRecordDto GetLastLevelByCode(string countyCode);

        /// <summary>
        /// 更新已有子级代理商
        /// </summary>
        /// <param name="agentAreaRecordId">代理商区域记录ID</param>
        /// <param name="countyCode">区县编码</param>
        void UpdateIsChildAgent(long agentAreaRecordId, string countyCode);
    }
}
